import time
def read(file):
    f = open(file)
    s = [int(x) for x in f]
    return s
def func(a):
    for j in range(len(a) - 1):
        for i in range(len(a) - j - 1):
            if a[i] > a[i + 1]:
                a[i], a[i + 1] = a[i + 1], a[i]
    return a
m1 = read("/home/student/Рабочий стол/житомирский егор/m1_sorted.txt")
m2 = read("/home/student/Рабочий стол/житомирский егор/m2_reverse.txt")
m3 = read("/home/student/Рабочий стол/житомирский егор/m3_shuffle.txt")
m1_s = time.time()
m1_line = func(m1)
m1_f = time.time()
m2_s = time.time()
m2_line = func(m2)
m2_f = time.time()
m3_s = time.time()
m3_line = func(m3)
m3_f = time.time()
print("m1_sorted", round((m1_f-m1_s)*1000), "millsecond")
print("m2_reverse", round((m2_f-m2_s)*1000), "millsecond")
print("m3_shuffle", round((m3_f-m3_s)*1000), "millsecond")
